//@ sourceURL=AccidentInjuryForm.js
AccidentInjuryForm = Ext.extend(Ext.Window,
{
    constructor : function(a) {
        Ext.applyIf(this, a);
        this.initUIComponents();
        AccidentInjuryForm.superclass.constructor.call(this, {
            layout : "fit",
            id : this.inputFormName,
            items : yearGridFormPanel,
            modal : true,
            bodyStyle : "padding:2px;",
            buttonAlign : "center",
            buttons : yearGridFormButtons,
            title : "添加",
            iconCls : "menu-flowWait",
            width : 620,
            height : 450
        });
    },
    //初始化数据
    initUIComponents : function() {
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/health/saveAccidentInjury.do",
                items:[
                {
                    id : "accidentInjury.id",
                    name : "accidentInjury.id",
                    xtype : "hidden",
                    value : this.id == null ? "": this.id
                }, {
                    name : "accidentInjury.years",
                    xtype : "hidden",
                    id : "accidentInjury.years",
                    value : this.years == null ? "" : this.years
                },{
                    layout:"column",
                    bodyStyle:"padding:5px;",
                    items:[{
                        layout:"form",
                        bodyStyle:"padding:5px;",
                        defaultType:"textfield",
                        border:false,
                        columnWidth:0.5,
                        items:[{
                            fieldLabel: '所属机构',
                            width : 146,
                            name: 'accidentInjury.institution'
                            
                        }]
                },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '事故名称'+'<font color=red>*</font>', 
                       name: 'accidentInjury.accidentName',
                       allowBlank:false,
                       width : 146,
                       blankText:"事故名称不能为空！"
                       
                       }]
                   },{
                       layout:"form",
                       border:false,
                       bodyStyle:"padding:5px;",
                       columnWidth:.5,
                       items:[{
                           //下拉选型设置
                               fieldLabel : "事故等级",
                               hiddenName : "accidentInjury.accidentGrade",
                               xtype : "combo",
                               mode : "local",
                               width : 146 ,
                               editable : false,
                               triggerAction : "all",
                               store : [
                                        [ "1",  "特别重大事故" ],
                                        [ "2",  "重大事故" ],
                                        [ "3",  "较大事故" ], 
                                        [ "4",  "一般事故" ] ],
                                value : 4
                       }]
                   
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '员工名称',
                       width : 146,
                       name: 'accidentInjury.personName'
                      
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '所在部门', 
                       width : 146,
                       name: 'accidentInjury.department'
                      
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '经办人',
                       width : 146,
                       name: 'accidentInjury.managers'
                      
                       }]
                   },{
                       layout:"form",
                       border:false,
                       bodyStyle:"padding:5px;",
                       columnWidth:.5,
                       items:[{
                           xtype:"datefield",
                           fieldLabel:'事故时间'+'<font color=red>*</font>',
                           id:"accidentInjury.accidentDate",
                           format:"y-m-d",
                           name:"accidentInjury.accidentDate",
                           width:146,
                           allowBlank:false,
                           blankText:"事故时间不能为空！"
                       }]
                   },{
                       layout:"form",
                       border:false,
                       bodyStyle:"padding:5px;",
                       columnWidth:.5,
                       items:[{
                           xtype:"datefield",
                           fieldLabel:'处理时间'+'<font color=red>*</font>',
                           id:"accidentInjury.handleDate",
                           format:"y-m-d",
                           name:"accidentInjury.handleDate",
                           width:146,
                           allowBlank:false,
                           blankText:"处理时间不能为空！"
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:.5,
                       border:false,
                       defaultType:"textfield",
                       items:[{
                       fieldLabel: '工伤证书编号',
                       width : 146,
                       name: 'accidentInjury.certificateNo' 
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       items:[{
                       xtype:"textarea",
                       fieldLabel: '受伤经过', 
                       name: 'accidentInjury.injuredAfter', 
                       width : 448 
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       items:[{
                       xtype:"textarea",
                       fieldLabel: '受伤原因及责任人', 
                       name: 'accidentInjury.personLiable', 
                       width : 448 
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       items:[{
                       xtype:"textarea",
                       fieldLabel: '领导处理意见', 
                       name: 'accidentInjury.opinion', 
                       width : 448 
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       items:[{
                       xtype:"textarea", 
                       fieldLabel: '备注', 
                       name: 'accidentInjury.remark',
                       width : 448 
                       
                       }]
                   }]
               }
               ]
            },
            loadData:{
                getUrl:__ctxPath +"/health/getAccidentInjury.do",
                preName : "accidentInjury"
            },
            isShow:this.isShow
        });
    }
});
